|
 |
Chris Huff <chr### [at] mac com> wrote:
: Besides, why won't the workaround of creating them with a macro work?
: You can put the transformation in the macro, and call it multiple times
: to give them different positions, colors, etc. A pretty clumsy
: workaround, but it should work.
What I wonder why it can't work like a light_source. You can put a
light_source inside a CSG and all transformations applied to the CSG will
transform the light_source as well. Why the glow can't work in the same
way?
And answering your question, it may be quite complicated sometimes.
Just consider something like this:
// Candle:
union
{ union
{ union
{ light_source // Candle light
{ 0, 1 glow { ... }
translate y*1
}
cone { ... } // Top of candle
cylinder { ... } // Body of candle
translate y*5
}
union
{ // some candlestick stuff here
translate y*-2
}
scale 2 translate y*-5
}
union
{ // Some lantern stuff here
}
scale 5 rotate z*30 translate <10,20,30>
}
It breaks entirely the ideology and structure of a CSG if some sub-part of
it is not transformed by outer transformations.
Besides this, it's not easy at all to calculate the right location value
inside the glow-block.
Also if you change any of the transformations of the CSG, everything else
changes accordingly, except the glow, which you have to remember to
recalculate again.
Suppose that I want to declare that object as an identifier which I could
put in an #include file. The only way of making it work would be making it
a macro. Again, it would break the ideology of delcared objects. I could
not say anymore:
union
{ object { Candle scale .25 translate y*5 }
object { Table }
translate <1,2,3>
}
: BTW, another thing I have been thinking of adding: a "multiglow" or
: compound glow. Basically a glow with multiple locations, it would act
: like a group of glows having everything but location identical. The main
: advantage would be memory, you would only have to store another vector
: to make each new glow. There might also be a slight speed gain, since it
: would eliminate walking along a linked list...but probably not
: noticeable. What do you think?
Yes, it sounds useful.
Btw, I think there could be better (and faster and less memory-consuming)
ways of storing the glows than a linked list.
Just imagine if the triangles of a mesh were in a linked list... ;)
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |